package com.example.demo.server;

import com.example.demo.mapper.loingMapper;
import com.example.demo.model.Administrator;
import com.example.demo.model.Leave;
import com.example.demo.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class loingServer {
    @Autowired(required = false)
    public loingMapper mapper;

    //前台注册
    public int add(User user){
        System.out.println(user);
      return mapper.add(user);
    }
    //前台登录查询账号密码
    public User seleup(String uname,String password){
        return mapper.seleUp(uname,password);
    }

    //后台登录
    public Administrator seleAd(String user,String password){
     return mapper.seleAd(user,password);
    }

    //前台留言
    public int addLeave(Leave leave){
        System.out.println(leave);
        return mapper.addLeave(leave);
    }

}
